package com.springcloud.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * RefreshScope 动态刷新
 * 动态刷新地址  http://localhost:61000/actuator/refresh
 * @author: 顾志杰
 */
@RestController
@RequestMapping("refresh")
@RefreshScope
public class RefreshController {

    @Value("${words}")
    private String words;

    @Value("${food}")
    private String food;

    @GetMapping("words")
    public String getWords(){
        return words;
    }

    @GetMapping("dinner")
    public String dinner(){
        return food;
    }
}
